/**
 * 
 */
package com.nandasoft.njurep.substance.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.stereotype.Repository;

import com.nandasoft.njuerp.common.dao.BaseDao;
import com.nandasoft.njurep.substance.bean.WareStoreDetailBean;
import com.nandasoft.njurep.substance.dao.WareStoreDetailDao;

/**
 * @title  事务明细数据DAO
 * @author Administrator
 * @date 2016年9月28日 下午2:33:32 
 */
@Repository("wareStoreDetailDao")
public class WareStoreDetailDaoImpl extends BaseDao<WareStoreDetailBean> implements WareStoreDetailDao {

	/* (non-Javadoc)
	 * @see com.nandasoft.njurep.substance.dao.WareStoreDetailDao#insertWareStoreDetailInfo(java.util.List)
	 */
	@Override
	public void insertWareStoreDetailInfo(List<WareStoreDetailBean> wsdList) {
		// TODO Auto-generated method stub
		String sql="insert into T_WARE_STORE_DETAIL values (:id,:billid,:seq,:transtype,:kyear,:kmonth,:kday,:warecode,:partcode,:stationcode,:batcode,:batdesc,:orignum,:orinum,:oriprice0,:oriprice1,:orisum0,:orisum1,:innum,:inprice0,:inprice1,"
						+":insum0,:insum1,:outnum,:outprice0,:outprice1,:outsum0,:outsum1,:adjnum,:adjprice0,:adjprice1,:adjsum0,:adjsum1,:feesum0,"
						+":feesum1,:taxrate,:discount,:ordercode,:orderseq,:sprice0,:sprice1,:votag,:vocode,:invcheck,:flowtag,:chadate,:state,:deptcode,:linecode,:buscode,:note,createdBy,cTime,:updateBy,:utime)";
		for (WareStoreDetailBean wareStoreDetailBean : wsdList) {
			SqlParameterSource paramSource = new BeanPropertySqlParameterSource(wareStoreDetailBean);
			insert(sql, paramSource);
		}
	}
	
	/* (non-Javadoc)
	 * @see com.nandasoft.njurep.substance.dao.WareStoreDetailDao#updateWareStoreDetailInfo(com.nandasoft.njurep.substance.bean.WareStoreDetailBean)
	 */
	@Override
	public void updateWareStoreDetailInfo(String wId,String state) {
		// TODO Auto-generated method stub
		String sql="update T_WARE_STORE_DETAIL  set  state = :state where id=:id";
		Map<String, String> map = new HashMap<String, String>();
		map.put("state", state);
		map.put("id", wId);
		update(sql, map);
	}



	/* (non-Javadoc)
	 * @see com.nandasoft.njurep.substance.dao.WareStoreDetailDao#deleteWareStoreDetailInfo(java.lang.String)
	 */
	@Override
	public void deleteWareStoreDetailInfo(String wId) {
		// TODO Auto-generated method stub
		updateWareStoreDetailInfo(wId,"4");
	}

	/* (non-Javadoc)
	 * @see com.nandasoft.njurep.substance.dao.WareStoreDetailDao#getWSDList(java.lang.String)
	 */
	@Override
	public List<WareStoreDetailBean> getWSDList(String wId) {
		// TODO Auto-generated method stub
		
		return null;
	}
}
